<?php
/**
 * Created by PhpStorm.
 * User: mf
 * Date: 2017/9/4
 * Time: 11:39
 */
namespace app\admin\validate;

class User extends Base
{
    //商家申请入驻
    public static function sellerApply()
    {
        return [
            'rule' => [
                'username' => 'require|length:4,16|chsDash',
                'password' => 'require',
                'repassword'=>'require|confirm:password',
                'sellerName' => 'require',
                'mobile' => 'require|length:11|number',
                'mobileCode' => 'require',
                'email' => 'require|email',
                'address' => 'require'
            ],
            'msg' => [
                'username.require' => '用户名不能为空',
                'username.length' => '用户名长度在4~16位',
                'username.chsDash' => '用户名只能是汉字、字母、数字和下划线_及破折号-',
                'password.require' => '密码不能为空',
                'repassword.require' => '确认密码不能为空',
                'repassword.confirm' => '确认密码不一致',
                'sellerName.require' => '公司名称不能为空',
                'mobile.require' => '手机号码不能为空',
                'mobile.length' => '手机号码长度为11位',
                'mobile.number' => '手机号码只能是数字',
                'mobileCode.require' => '验证码不能为空',
                'email.require' => '邮箱不能为空',
                'email.email' => '邮箱格式不正确',
                'address.require' => '请选择公司注册地点'
            ]
        ];
    }

    //完善商家信息
    public static function addSellerMsg()
    {
        return [
            'rule' => [
                'contactman' => 'require|chsAlpha',
                'bankName' => 'require|chs',
                'bankCardNum' => 'require|number',
                'description' => 'require',
                'comment' => 'require',
                'certificate' => 'require',
                'range' => 'require|max:30',
                'logo' => 'require'
            ],
            'msg' => [
                'contactman.require' => '联系人不能为空',
                'contactman.chsAlpha' => '联系人名称只能是汉字和字母',
                'bankName.require' => '银行名称不能为空',
                'bankName.chsAlpha' => '银行名称只能是汉字',
                'bankCardNum.require' => '银行卡号不能为空',
                'bankCardNum.number' => '银行卡号只能是数字',
                'description.require' => '公司简介不能为空',
                'comment.require' => '公司备注不能为空',
                'certificate.require' => '请上传公司营业执照',
                'range.require' => '请填写公司主营范围',
                'range.max' => '公司主营范围不超过30个字',
                'logo.require' => '请上传公司logo'
            ]
        ];
    }

    //登录(status-1审核未通过0正在审核中1审核通过，允许登录)
    public static function login()
    {
        return [
            'rule' => [
                'username' => 'require|length:4,16',
                'password' => 'require'
            ],
            'msg' => [
                'username.require' => '用户名不能为空',
                'username.length' => '用户名长度在4~16位',
                'password.require' => '密码不能为空'
            ]
        ];
    }

    //谦程网络添加支队和总队账户
    public static function addTeam()
    {
        return [
            'rule' => [
                'username' => 'require|length:4,16|chsDash',
                'password' => 'require',
                'teamName'=>'require',
            ],
            'msg' => [
                'username.require' => '用户名不能为空',
                'username.length' => '用户名长度在4~16位',
                'username.chsDash' => '用户名只能是汉字、字母、数字和下划线_及破折号-',
                'password.require' => '密码不能为空',
                'teamName.require' => '总队或支队名称不能为空'
            ]
        ];
    }
}